from .AIAssistant import AIAssistant

class TranslationAssistant(AIAssistant):
    """翻译助手类，专门用于处理翻译相关任务"""
    
    def __init__(self, id, name, version, online, score, supported_languages, is_professional):
        super().__init__(id, name, "翻译助手", version, online, score)
        self._supported_languages = supported_languages
        self._is_professional = is_professional
    
    # Getter和Setter方法
    @property
    def supported_languages(self):
        return self._supported_languages
    
    @supported_languages.setter
    def supported_languages(self, supported_languages):
        self._supported_languages = supported_languages
    
    @property
    def is_professional(self):
        return self._is_professional
    
    @is_professional.setter
    def is_professional(self, is_professional):
        self._is_professional = is_professional
    
    def process_task(self, task_content):
        """处理翻译任务"""
        print(f"正在为【{self.name}】分配翻译任务：{task_content}")
        
        # 模拟翻译处理过程
        professional_tag = "（专业领域）" if self._is_professional else ""
        self.status_message = f"翻译完成：{task_content}{professional_tag}"
        print(f"✅ {self.status_message}")
        return True
    
    def display_info(self):
        """显示助手的详细信息"""
        super().display_info()
        print(f"   支持的语言对: {self._supported_languages}")
        print(f"   是否支持专业领域: {'是' if self._is_professional else '否'}")